package valve_test.logic;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
/**
 * Created with IntelliJ IDEA.
 * User: Shinigami
 * Date: 11.03.14
 * Time: 18:16
 * To change this template use File | Settings | File Templates.
 */

@Entity
@Table(name="ierarchy")
public class ierarchy {

    private Long id;
    private Long p_id;
    private Long c_id;
    private Long p_o;
    private Long c_i;

    public ierarchy(){
        id = null;
        p_id = null;
        c_id = null;
        p_o = 1L;
        c_i = 1L;
    }

    public ierarchy(ierarchy s){
        id = s.getId();
        p_id = s.getP_id();
        c_id = s.getC_id();
        p_o = s.getP_o();
        c_i = s.getC_i();
    }

    @Id
    @GeneratedValue(generator="increment")
    @GenericGenerator(name="increment", strategy = "increment")
    @Column(name="id")
    public Long getId() {
        return id;
    }

    @Column(name="p_id")
    public Long getP_id(){
        return p_id;
    }

    @Column(name="c_id")
    public Long getC_id(){
        return c_id;
    }

    @Column(name="p_o")
    public Long getP_o(){
        return p_o;
    }

    @Column(name="c_i")
    public Long getC_i(){
        return c_i;
    }

    public void setId(Long i){
        id = i;
    }

    public void setP_id(Long s){
        p_id = s;
    }

    public void setC_id(Long s){
        c_id = s;
    }

    public void setP_o(Long s){
        p_o = s;
    }

    public void setC_i(Long s){
        c_i = s;
    }
}
